package com.yc.cloud.portal;

import com.yc.cloud.common.websocket.core.SocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(scanBasePackages = {"com.yc.cloud"})
@EnableScheduling
@Slf4j
public class PortalApplication implements CommandLineRunner {
    @Autowired
    private SocketServer socketServer;

    public static void main(String[] args) {
        SpringApplication.run(PortalApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("PortalApplication is running...");
        socketServer.setNamespace("/customAR");
        socketServer.start();
    }
}
